<?php
/*
 * Created on 22.12.2005
 *
 */

/**
 * attributes:
 * 
 * id: id of html element to show (display = 'block')
 */
class ajax_replaceInnerHtmlHandler
{
    
    var $id = null;

    function startElement (& $sender, $attrs, $line)
    {
        if (!$attrs['id'])
            $sender->appendCode('$out->write("alert(\'Attribute id is missing in tag ajax:replaceInnerHtml in line '.$line.'!\');");');
        else
        {
            $this->id = $attrs['id'];
        }
    }

    function endElement (& $sender)
    {
        if ($this->id != null)
            $sender->appendCode('$out->write("phpinchains.addWidgetSearchId('.$this->id.');dojo.byId('.$this->id.').innerHTML = \'".str_replace("\'", "\\\'",str_replace("\r", " ", str_replace("\n", " ", $__replacement)))."\';");');
    }

}

?>